#import "MessageQoSEventListener.h"

@implementation MessageQoSEventListener

- (id) initWithEmitter:(RCTEventEmitter *)emitter{
  if ((self = [super init])) {
    _emitter = emitter;
  }
  return self;
}

- (void) messagesLost:(NSMutableArray *)lostMessages{
  [_emitter sendEventWithName: @"messagesLost" 
                         body: @{
                           @"count": [NSNumber numberWithUnsignedLong: (unsigned long)[lostMessages count]]
                         }
  ];
}

- (void) messagesBeReceived:(NSString *)theFingerPrint{
  [_emitter sendEventWithName: @"messagesBeReceived" 
                         body: @{
                           @"fp": theFingerPrint
                         }
  ];
}

@end
